package com.novax.ex.activity.provider.service;

import com.novax.ex.activity.infrastructure.entity.TaskReward;
import com.novax.ex.activity.infrastructure.entity.TaskUserProgress;
import com.novax.ex.activity.infrastructure.entity.TaskVersionConfig;
import com.novax.ex.activity.infrastructure.mapper.TaskRewardMapper;
import com.novax.ex.activity.infrastructure.mapper.TaskUserProgressMapper;
import com.novax.ex.activity.infrastructure.mapper.TaskVersionConfigMapper;
import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * @Description 奖励配置 service
 * @Author ChenXi
 * @Date 2023/06/20/15:43
 */

@Service
public class TaskRewardService extends BaseService {

    @Resource
    private TaskRewardMapper taskRewardMapper;
    @Resource
    private TaskUserProgressMapper taskUserProgressMapper;
    @Resource
    private TaskVersionConfigMapper taskVersionConfigMapper;

    @Override
    protected BaseMapper getBaseMapper() {
        return taskRewardMapper;
    }

    public List<TaskReward> findAll() {
        return taskRewardMapper.selectAll();
    }


//    public List<TaskReward> findRewardByUid(Long userId) {
//        Long versionId = taskUserProgressMapper.selectVersion(userId);
//        if (Objects.isNull(versionId)) {
//            versionId = taskVersionConfigMapper.selectFirstVersion().getId();
//        }
//        return taskRewardMapper.selectRewardByVersionId(versionId);
//    }

}
